package
{
	import asset.toolPanelAsset;
	
	import flash.events.Event;
	import flash.events.MouseEvent;

	public class ToolPanelView extends toolPanelAsset
	{
		public function ToolPanelView()
		{
			btnMap.buttonMode=btnRole.buttonMode=true;
			resetBtn();
			btnMap.gotoAndStop(2);
			
			btnMap.addEventListener(MouseEvent.CLICK, __onClick);
			btnRole.addEventListener(MouseEvent.CLICK, __onClick);
			
			addEventListener(Event.ADDED_TO_STAGE, onAddStage);
		}
		
		private function __onClick(evt:MouseEvent):void
		{
			resetBtn();
			evt.target.gotoAndStop(2);
		}
		
		private function onAddStage(evt:Event):void
		{
			stage.addEventListener(Event.RESIZE, onReSize);
		}
		
		private function onReSize(evt:Event):void
		{
			toolBg.width=stage.stageWidth+10;
		}
		
		private function resetBtn():void
		{
			btnMap.gotoAndStop(1);
			btnRole.gotoAndStop(1);
		}
	}
}